package com.jfinal.module.wxchat;

import org.junit.Test;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.text.ParseException;

/**
 * <p>
 * .
 * </p>
 *
 * @author Jerry Ou
 * @version 1.0 2014-02-12 13:41
 * @since JDK 1.6
 */
public class DefaultWx {

    public static final String APPID = "wxec243dad70f9539a";
    public static final String APPSERCT = "e7dbddf8aff13fe0c59222b802ed7c06";

    @Test
    public void t() throws ParseException {
        /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Date d1 = sdf.parse("1970-01-01 00:00:00");
        Date d = new Date((d1.getTime() + 1397493758));
        System.out.println(System.currentTimeMillis());
        System.out.println(sdf.format(d));*/
        /*String t = "title1397662414979";
        String x = t.substring("title".length());
        System.out.println(x + "===" + t.indexOf("title"));*/

        /*String s = "aaaa<aaa>aaaa";
        String s1 = s.replaceAll("<aaa>", "bbb");
        System.out.println(s1);*/
        String s = "SequenceNumber=0&fmt=js&sv=1.0&gid=13000049&pid=0&data=%7B%22collectdate%22%3A%222014-04-29%2010%3A12%3A26%22%2C%22pulse%22%3A93%2C%22oxygen%22%3A98%2C%22apptype%22%3A%22Spo2DataV1%22%2C%22datakey%22%3A%22020000000013000049080104141300013000000000000000000000%22%2C%22adddate%22%3A%222014-04-29%2010%3A12%3A55%22%7D&st=&retry=0&tick=0";
        try {
            System.out.println(URLDecoder.decode(s, "utf-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

    }
}
